#!/usr/bin/env python
# -*- coding: utf-8 -*-
#@File  : renameVideoName.py
#@Author: pyc
#@Date  : 2021/4/9
# coding = 'utf-8'
import os


def rename(path):
    FileList = os.listdir(path)
    '遍历所有文件'
    for file in FileList:
        oldDirPath = os.path.join(path, file)
        print(file)
        filename=file.split('(Av')[0]
        print(filename)
        fileType = os.path.splitext(file)[1]
        print(fileType)
        newDirPath = os.path.join(path, filename + fileType)
        os.rename(oldDirPath, newDirPath)


path = 'D:\Program Files\JiJiDown\Download\电商平台数据可视化实时监控系统-Echarts-vue'
rename(path)